#include <iostream>
#include <thread>
#include <boost/bind.hpp>
#include <boost/asio.hpp>
#include "client.h"
using namespace std;

int main()
{
	boost::asio::io_service io_service;
	Client client(io_service, "127.0.0.1", 8900);

	std::thread thread(boost::bind(&boost::asio::io_service::run, &io_service));

	string buffer;
	while(getline(cin, buffer))
	{
		client.sendMessage(buffer);
		buffer.clear();
	}

	thread.join();

	return 0;
}
